<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <title>寻医问药</title>
    <!-- Bootstrap core CSS -->
    <link rel="stylesheet" href="{{asset('/bootstrap.min.css')}}">
    <link rel="stylesheet" href="{{asset('/dashboard.css')}}">
    <link rel="stylesheet" href="{{asset('/bootstrap-theme.min.css')}}">
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="{{asset('jquery.js')}}"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="{{asset('/bootstrap.min.js')}}"></script>
</head>
<body>
@include('business.topNAV')
<div class="container-fluid">
    <div class="row">
        @extends('business.leftNav')
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <h2 class="page-header">我的药品 | <button type="button" class="btn btn-primary  btn-sm" data-toggle="modal" data-target="#addArea">上架药品</button></h2>
            @if(session('__Ajax_RedirectFunc_status') == true)
                <div>
                    <div class="alert alert-success alert-dismissible fade in" role="alert">
                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                        <h3>成功</h3>
                        <p><?php echo session('__Ajax_RedirectFunc_message');?></p>
                        <p><?php echo session('__Ajax_RedirectFunc_plugin');?></p>
                    </div>
                </div>
            @endif
            @if(session('__Ajax_RedirectFunc_status') === false)
                <div >
                    <div class="alert alert-danger alert-dismissible fade in" role="alert">
                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                        <h3>失败</h3>
                        <p><?php echo session('__Ajax_RedirectFunc_message');?></p>
                        <p><?php echo session('__Ajax_RedirectFunc_plugin');?></p>
                    </div>
                </div>
            @endif
            <div class="panel-body" >
                <div class="modal fade" id="addArea" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                                <h4 class="modal-title" id="myModalLabel">上架药品</h4>
                            </div>
                            <div class="modal-body">
                                <form action="/addGoods" method="post">
                                    <input type="hidden" name="_token" value="{{ csrf_token() }}">
                                    <h5>药品名称</h5>
                                    <input type="text"  name="drug_name" class="form-control" placeholder="药品名称"  required autofocus><br>
                                    <h5>药品介绍</h5>
                                    <input type="text"  name="drug_info" class="form-control" placeholder="药品介绍"  required autofocus><br>
                                    <h5>治疗症状</h5>
                                    <input type="text"  name="drug_symptom" class="form-control" placeholder="治疗症状"  required autofocus><br>
                            </div>
                            <div class="modal-footer">
                                <button type="submit" class="btn btn-primary">上架</button>
                                <button type="button" class="btn btn-default" data-dismiss="modal">返回</button>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            <table class="table table-responsive table-condensed table-hover table-striped">
                <thead>
                <tr>
                    <th>上架时间</th>
                    <th>药品名称</th>
                    <th>药品介绍</th>
                    <th>治疗症状</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                @foreach($drugData as $data)
                    <tr>
                        <td>{{$data->drug_time}}</td>
                        <td>{{$data->drug_name}}</td>
                        <td>{{$data->drug_info}}</td>
                        <td>{{$data->drug_symptom}}</td>
                        <td><button type="button" class="btn btn-danger  btn-sm" data-toggle="modal" data-target="#delDrug{{$data->drug_id}}">下架</button></td>
                        <div class="modal fade" id="delDrug{{$data->drug_id}}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                            <div class="modal-dialog">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                                        <h4 class="modal-title" id="myModalLabel">下架药品</h4>
                                    </div>
                                    <div class="modal-body">
                                        <form action="/delGoods" method="post">
                                            <input type="hidden" name="_token" value="{{ csrf_token() }}">
                                            <input type="hidden"  name="drug_id" value="{{$data->drug_id}}" >
                                            确定要下架吗？
                                    </div>
                                    <div class="modal-footer">
                                        <button type="submit" class="btn btn-danger">下架</button>
                                        <button type="button" class="btn btn-default" data-dismiss="modal">返回</button>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </tr>
                @endforeach
                </tbody>
            </table>
                <ul class="list text-center">

                </ul>
        </div>
    </div>
</div>
</body>
</html>